package com.heima.wemedia.utils;

/**
 * @Author：shi_xin_rui
 * @name：UserIdThreadUtil
 * @Date：2023/6/4 15:37
 */
public class UserIdThreadUtil {

    private final static ThreadLocal<Integer> WM_USER_THREAD_LOCAL = new ThreadLocal<>();

    // 设置id
    public static void setUserId(Integer id){
        WM_USER_THREAD_LOCAL.set(id);
    }

    // 获取id
    public static Integer get(){
        return WM_USER_THREAD_LOCAL.get();
    }

    //清除id
    public static void remove(){
        WM_USER_THREAD_LOCAL.remove();
    }
}
